import 'package:flutter_lihui/json_entity_model/listbeanall_entity.dart';

listbeanallEntityFromJson(ListbeanallEntity data, Map<String, dynamic> json) {
	if (json['state'] != null) {
		data.state = json['state'];
	}
	if (json['value'] != null) {
		data.value = new List<ListbeanallValue>();
		(json['value'] as List).forEach((v) {
			data.value.add(new ListbeanallValue().fromJson(v));
		});
	}
	return data;
}

Map<String, dynamic> listbeanallEntityToJson(ListbeanallEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['state'] = entity.state;
	if (entity.value != null) {
		data['value'] =  entity.value.map((v) => v.toJson()).toList();
	}
	return data;
}

listbeanallValueFromJson(ListbeanallValue data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['title'] != null) {
		data.title = json['title'].toString();
	}
	if (json['picSrc'] != null) {
		data.picSrc = json['picSrc'].toString();
	}
	if (json['code'] != null) {
		data.code = json['code'].toString();
	}
	if (json['productType'] != null) {
		data.productType = json['productType'] is String
				? int.tryParse(json['productType'])
				: json['productType'].toInt();
	}
	if (json['creationDate'] != null) {
		data.creationDate = json['creationDate'] is String
				? int.tryParse(json['creationDate'])
				: json['creationDate'].toInt();
	}
	if (json['updationDate'] != null) {
		data.updationDate = json['updationDate'] is String
				? int.tryParse(json['updationDate'])
				: json['updationDate'].toInt();
	}
	if (json['enabledFlag'] != null) {
		data.enabledFlag = json['enabledFlag'] is String
				? int.tryParse(json['enabledFlag'])
				: json['enabledFlag'].toInt();
	}
	if (json['sort'] != null) {
		data.sort = json['sort'] is String
				? int.tryParse(json['sort'])
				: json['sort'].toInt();
	}
	if (json['page'] != null) {
		data.page = json['page'].toString();
	}
	if (json['point'] != null) {
		data.point = json['point'].toString();
	}
	if (json['price'] != null) {
		data.price = json['price'].toString();
	}
	if (json['listPrice'] != null) {
		data.listPrice = json['listPrice'].toString();
	}
	if (json['moduleName'] != null) {
		data.moduleName = json['moduleName'].toString();
	}
	if (json['updationDa'] != null) {
		data.updationDa = json['updationDa'] is String
				? int.tryParse(json['updationDa'])
				: json['updationDa'].toInt();
	}
	return data;
}

Map<String, dynamic> listbeanallValueToJson(ListbeanallValue entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['title'] = entity.title;
	data['picSrc'] = entity.picSrc;
	data['code'] = entity.code;
	data['productType'] = entity.productType;
	data['creationDate'] = entity.creationDate;
	data['updationDate'] = entity.updationDate;
	data['enabledFlag'] = entity.enabledFlag;
	data['sort'] = entity.sort;
	data['page'] = entity.page;
	data['point'] = entity.point;
	data['price'] = entity.price;
	data['listPrice'] = entity.listPrice;
	data['moduleName'] = entity.moduleName;
	data['updationDa'] = entity.updationDa;
	return data;
}